#include <iostream>
#include "../aip-cpp-sdk/speech.h"

using namespace std;
using namespace aip;
string app_id = "17496766";
string api_key = "gG1oXkYhqC72KbsfKNawHZNv";
string secret_key = "ijAXKgNwUaQZbbVXryZmef6DnouQ6EnS";

int main()
{
	aip::Speech client(app_id, api_key, secret_key);

	ofstream ofile;
	string file_ret;

	map<string, string> options;

	options["aue"]="6";
	ofile.open("test.wav", ios::out|ios::binary);



	Json::Value result = client.text2audio("华清远见欢迎你", options, file_ret);
	if (!file_ret.empty()) {
		ofile << file_ret;
	}
	else {
		cout << result.toStyledString();
	}

	system("aplay -q test.wav");
	return 0;
}

